/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.converters;

import org.jdesktop.beansbinding.Converter;

/**
 *
 * @author Bone
 */
public class ConversorBoolean extends Converter<Short, Boolean>{

    @Override
    public Short convertReverse(Boolean value) {
        String val = value.toString();
        if(val.equals("true")){
            val = "1";
        }else{
            val = "0";
        }
        return Short.parseShort(val);
    }

    @Override
    public Boolean convertForward(Short value) {
        String val = value.toString();
        if(val.equals("0")){
            val = "false";
        }else{
            val = "true";
        }
        return Boolean.valueOf(val);
    }

    
}
